package homework;

import java.util.Scanner;

public class Test3 {
    String str=new String("good");
    char[] ch={'a','b','c'};
    public void change(String str,char ch[]){
        str="test ok";
        ch[0]='g';
    }

    public static void main(String[] args) {
        Test3 t=new Test3();
        t.change(t.str,t.ch);
        System.out.println(t.str+"and");
        System.out.println(t.ch);
    }

    public static void main7(String[] args) {
        boolean b=true?false:true==true?false:true;
        System.out.println(b);
    }
    public static void main6(String[] args) {
        String[] argsd=new String[]{"java f a b c"};
        String foo1=argsd[1];
        String foo2=argsd[2];
        String foo3=argsd[3];
        System.out.println(foo1+" "+foo2+" "+foo3);
    }
    public static void main5(String[] args) {
        Object o=new Object(){
            public  boolean equals(Object obj){
                return true;
            }
        };
        System.out.println(o.equals("Fred"));
    }
    public static void main4(String[] args) {
        System.out.println(100%3);
        System.out.println(100%3.0);
    }
    public static void main3(String[] args) {
        Scanner console = new Scanner(System.in);
        int price = console.nextInt();
        int cost = 0;

        //write your code here......
        //考虑到购买5000元东西的人很少，应从小到大判断，以减少判断次数
        cost=(int)(price<100 ? price : price<500
                ? price*0.9 : price<2000
                ? price*0.8 : price<5000
                ? price*0.7 : price*0.6);
        System.out.println(cost);
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int a=in.nextInt();
        int b=in.nextInt();
        a=a^b;
        b=a^b;
        a=a^b;
        System.out.println(a+" "+b);
    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        float b=in.nextFloat();
        float c=b%1;
        int a=0;
        if(c>0.5){
            a=(int)b+1;
        }else{
            a=(int)b;
        }
        System.out.println(a);
    }
}
